home *** CD-ROM | disk | FTP | other *** search
- {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
- DATA TRANSFER - note that we do NOT have to pay attention to the
- dialog's record structure; "Get/Set DataRec" (from the GENERAL
- unit) will access only sub-views which accept or return data.
-
- This lets us use plain, vanilla "string" type, so we can use the
- dialog's TInputLine to change the acceptable length of the field.
-
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
- {===================================================================
-
- DIALOG --> BUFFER (read each TInputLine field)
-
- ===================================================================}
- procedure GetAllFields ( D : PDialog ) ;
- var
- x : byte ;
- begin
- for x := 1 to FldCnt do
- GetDataRec ( D ,
- x ,
- @DataArray[CurRec][x] ) ;
- end ;
- {===================================================================
-
- BUFFER --> DIALOG (writes each TInputLine field)
-
- ===================================================================}
- procedure SetAllFields ( D : PDialog ) ;
- var
- x : byte ;
- begin
- for x := 1 to FldCnt do
- SetDataRec ( D ,
- x ,
- @DataArray[CurRec][x] ) ;
- SetDataRec ( D , FldCnt + 1 , @CurRec ) ;
- end ;
- {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
- EVENTS
-
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
- {-------------------------------------------------------------------
- PREV
- -------------------------------------------------------------------}
- procedure hdPrevRecord ;
- begin
- if CurRec = 1 then
- begin
- buzz ;
- EXIT ;
- end ;
- GetAllFields ( MyDialog ) ;
- dec ( CurRec ) ;
- SetAllFields ( MyDialog ) ;
- end ;
- {-------------------------------------------------------------------
- NEXT
- -------------------------------------------------------------------}
- procedure hdNextRecord ;
- begin
- if CurRec = MaxRecs then
- begin
- buzz ;
- EXIT ;
- end ;
- GetAllFields ( MyDialog ) ;
- inc ( CurRec ) ;
- SetAllFields ( MyDialog ) ;
- end ;
- {-------------------------------------------------------------------
- FIRST
- -------------------------------------------------------------------}
- procedure hdFirst ;
- begin
- GetAllFields ( MyDialog ) ;
- CurRec := 1 ;
- SetAllFields ( MyDialog ) ;
- end ;
- {-------------------------------------------------------------------
- LAST
- -------------------------------------------------------------------}
- procedure hdLast ;
- begin
- GetAllFields ( MyDialog ) ;
- CurRec := MaxRecs ;
- SetAllFields ( MyDialog ) ;
- end ;
-